home *** CD-ROM | disk | FTP | other *** search
/ Aminet 24 / Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso / Aminet / dev / lang / PPCSmllEiffel.lha / PPCSmallEiffel / lib_se / export_item.e < prev    next >
Text File  |  1998-01-16  |  2KB  |  87 lines

  1. --          This file is part of SmallEiffel The GNU Eiffel Compiler.
  2. --          Copyright (C) 1994-98 LORIA - UHP - CRIN - INRIA - FRANCE
  3. --            Dominique COLNET and Suzanne COLLIN - colnet@loria.fr 
  4. --                       http://www.loria.fr/SmallEiffel
  5. -- SmallEiffel is  free  software;  you can  redistribute it and/or modify it 
  6. -- under the terms of the GNU General Public License as published by the Free
  7. -- Software  Foundation;  either  version  2, or (at your option)  any  later 
  8. -- version. SmallEiffel is distributed in the hope that it will be useful,but
  9. -- WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  10. -- or  FITNESS FOR A PARTICULAR PURPOSE.   See the GNU General Public License 
  11. -- for  more  details.  You  should  have  received a copy of the GNU General 
  12. -- Public  License  along  with  SmallEiffel;  see the file COPYING.  If not,
  13. -- write to the  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  14. -- Boston, MA 02111-1307, USA.
  15. --
  16. class EXPORT_ITEM
  17. --   
  18. -- To store one item of the option "inherit ... export ... end".
  19. --
  20.  
  21. inherit GLOBALS;
  22.  
  23. creation {ANY}
  24.    make_all, make
  25.    
  26. feature {ANY}
  27.    
  28.    clients: CLIENT_LIST;
  29.    
  30.    list: FEATURE_NAME_LIST;
  31.    
  32. feature {ANY}
  33.    
  34.    make_all(c: like clients) is
  35.       require
  36.      c /= Void;
  37.       do
  38.      clients := c;
  39.      list := Void;
  40.       end;
  41.    
  42.    make(c: like clients; l: ARRAY[FEATURE_NAME]) is
  43.       require
  44.      c /= Void;
  45.      l /= Void;
  46.      not l.empty;
  47.       do
  48.      clients := c;
  49.      !!list.make(l);
  50.       ensure
  51.      clients = c;
  52.       end;
  53.    
  54.    for_all: BOOLEAN is
  55.      -- True when "all" primitives affected;
  56.       do
  57.      Result := list = Void;
  58.       end;
  59.    
  60.    affect(fn: FEATURE_NAME): BOOLEAN is
  61.       do
  62.      if for_all then
  63.         Result := true;
  64.      else
  65.         Result := list.has(fn);
  66.      end; 
  67.       end;
  68.       
  69.    pretty_print is
  70.       local
  71.      i: INTEGER;
  72.       do
  73.      clients.pretty_print;
  74.      if for_all then
  75.         fmt.keyword("all");
  76.      else
  77.         list.pretty_print;
  78.      end;
  79.       end;
  80.    
  81. invariant
  82.    
  83.    clients /= Void;
  84.    
  85. end -- EXPORT_ITEM
  86.  
  87.